<!DOCTYPE html>
<html>

<head>
    <title>FlowTrack</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
        body,
        html {
            width: 100%;
            height: 100%;
            margin: 0;
            font-family: "微软雅黑";
        }

        #allmap {
            width: 100%;
            height: 100%;
        }

        p {
            margin-left: 5px;
            font-size: 14px;
        }
    </style>
    <script>
    </script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=U3q69k0Dv0GCYNiiZeHPf7BS"></script>
    <script src="./data/lineString2.js"></script>
    <script src="../dist/inmap.js"></script>

</head>

<body>
    <div id="allmap"></div>
</body>

</html>
<script>
    var map = new inMap.Map({
        id: 'allmap',
        skin: 'Blueness',
        center: [105.403119, 38.028658],
        zoom: {
            value: 5,
            show: true,
            max: 6,
            min: 5
        },
    });
   
    var overlay1 = new inMap.LineStringOverlay({
        style: {
            normal: {
                globalCompositeOperation: 'lighter',
                borderColor: 'rgba(55, 50, 250, 0.6)',
                borderWidth: 0.5,
                shadowColor: 'rgba(55, 50, 250, 0.5)',
                shadowBlur: 10,
            },
        },
        data: data.map(function (item, index) {
            item.name = '轨迹' + index;
            item.count = index;
            return item;
        }),
        event: {
            onState(state) {
                console.log(state);
            }
        }
    });
    map.add(overlay1);
    var data2 = [].concat(data);
    var overlay2 = new inMap.LineStringAnimationOverlay({
        style: {
            globalCompositeOperation: 'lighter',
            //移动点半径
            size: 0.8,
            //移动点颜色
            fillColor: 'rgba(255, 250, 250, 0.9)',
            //移动点阴影大小
            shadowBlur: 10,
            fps: 20,
            lineOrCurve: 'line', //curve or line
            deltaAngle: 50 
        },
        data: data2.map(function (item, index) {
            item.name = '轨迹' + index;
            item.count = index;
            return item;
        }),

    });
    map.add(overlay2);
</script>